﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Shen.RecipientShens;
using Volo.Abp.Application.Services;

namespace TianShiProject.Shen.RecipientShens
{
    public class RecipientShenService : ApplicationService
    {
        private readonly IRecipientShenRepository _recipientShenRepository;
        public RecipientShenService(IRecipientShenRepository recipientShenRepository)
        {
            _recipientShenRepository = recipientShenRepository;
        }
        /// <summary>
        /// 提交审批
        /// </summary>
        /// <returns></returns>
        public async Task<int> PostAddRecipient(RecipientShenDto RecipientShenDto, string loginname, int? loginid)
        {
            return await _recipientShenRepository.PostAddRecipient(RecipientShenDto, loginname, loginid);
        }
        /// <summary>
        /// 显示审批
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <returns></returns>
        public async Task<PageResponse<RecipientShenDto>> GetShowRecipient(int? state, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _recipientShenRepository.GetShowRecipient( state, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 待审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<RecipientShenDto>> GetDaiRecipient( int? state, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _recipientShenRepository.GetDaiRecipient( state, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 已审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<RecipientShenDto>> GetYiRecipient( int? state, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _recipientShenRepository.GetYiRecipient( state, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 审批通过
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutTongRecipient(Guid id)
        {
            return await _recipientShenRepository.PutTongRecipient(id);
        }
        /// <summary>
        /// 审批拒绝
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutJuRecipient(Guid id)
        {
            return await _recipientShenRepository.PutJuRecipient(id);
        }
    }
}
